import request from '@/utils/request'

//1. 查询所有学生
export function findStudents(data) {
  return request({
    url: '/student/findAll',
    method: 'get',
    data
  })
}

//2. 分页查询学生
export function findByPage(page,pagesize,data) {
  return request({
    url: `/student/findByPage/${page}/${pagesize}`,
    method: 'get',
    data
  })
}

//3. 分页带条件查询学生
export function search(page,pagesize,data) {
  // let studSearch = JSON.stringify(studentSearch)
  console.log("data:::",data)
  return request({
    url: `/student/search/${page}/${pagesize}`,
    method: 'post',
    data
  })
}

//4. 添加学生
export function add(data) {
  return request({
    url: `/student/add`,
    method: 'post',
    data
  })
}

//5. 修改学生
export function update(data) {
  return request({
    url: `/student/update`,
    method: 'post',
    data
  })
}

//6. 删除学生
export function delStud(sids) {
  console.log(sids)
  return request({
    url: `/student/delete/${sids}`,
    method: 'post'
  })
}
